Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / Device Communications Messages


GXBufferData

QuickDraw GX sends the GXBufferData message to send data to the device using the standard buffering mechanism. You can override the GXBufferData message to provide your own buffering scheme or to change data prior to buffering. Your override of the GXBufferData message must match the following formal declaration:

OSErr MyBufferData (Ptr data, long length, long bufferOptions);
data
A pointer to the data to add to the buffer.
length
The number of bytes of data to add.
bufferOptions
Options for adding the data to the buffer, as shown in Table 4-10.
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
QuickDraw GX sends the GXBufferData message in preparation for sending data to
a device using the standard buffering mechanism. This message is sent whenever any message handler wishes to buffer the data to be sent to the printing device.

The default implementation of this message uses the default buffering. It buffers the data until all of the buffers are full. You can specify buffering options in the bufferOptions parameter. The constants for these options are shown in Table 4-10.
Table 4-10 Options for adding data to the buffer
ConstantValueExplanation
gxNoBufferOptions0x00000000No options apply.
gxMakeBufferHex0x00000001All data is converted into ASCII hex equivalents: each byte becomes 2 ASCII bytes.
gxDontSplitBuffer0x00000002The data sent in this message cannot be split across buffers. If it is too large to fit into what is left of the current buffer, then add it to the next buffer instead.

When the buffers are completely full, QuickDraw GX sends the GXDumpBuffer message to write the data in the buffer to the device and then sends the GXFreeBuffer message to open the buffer to write additional data.

SPECIAL CONSIDERATIONS
You can send the GXBufferData message to add data to the printer's data stream.

If you are implementing your own buffering scheme, you need to perform a total override of the GXBufferData message. Otherwise, you need to modify the data and then forward the message.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
gxGBBufferTooSmallErrThe buffer is too small to accept the requested data, and you have specified that buffers are not to be split.
The default implementation of the GXBufferData message can also return the communications errors that are listed in Table 4-2 on page 4-42.

SEE ALSO
The GXDumpBuffer message is described on page 4-142.

The GXFreeBuffer message is described on page 4-143.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help